crates: improved json codec decoding performance#8718
Open
daywalker90 wants to merge 1 commit intoElementsProject:masterfrom
Open
crates: improved json codec decoding performance#8718daywalker90 wants to merge 1 commit intoElementsProject:masterfrom
daywalker90 wants to merge 1 commit intoElementsProject:masterfrom
Conversation
0be063a to
38edf7c
Compare
Member
|
Very cool, thanks @daywalker90, that quadratic explosion is my fault 🙇 |
Changelog-None
38edf7c to
4d8640c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to benchmark my plugin on a big node so i made use of the giantnode script which sadly crashed at ~660k payments because my
/tmpwas full but whatever. I noticed again that the rust crates take way longer for rpc calls than on the cli even when using.call_raw(). I already know it was because of theMultiLineCodecbut wasn't sure if it could be made faster and if so why it was so slow. So naturally i asked an LLM and it basically oneshotted something like this PR.I tested this with a small plugin:
which gives the following results:
Before:
After:
So from ~81s down to ~13s for typed calls.
For comparison on the cli it's basically equal to the "after, raw" pays: ~10s
Tested on debian 13 with an AMD Ryzen 5900x and 64GB RAM